<template>
  <div class="home">
    home
    <transition><p v-if="isShow">show</p></transition>
    
    <button @click="handleClick">切换</button>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  data(){
    return {
      isShow:true
    }
  },
  methods:{
    handleClick(){
      this.isShow = !this.isShow
    }
  }
}
</script>
<style scoped>
  .v-enter{
    opacity: 0;
  }
  .v-leave{
    opacity: 1;
  }
  .v-leave-to{
    opacity: 0;
  }
  .v-enter-active,.v-leave-active{
    transition: opacity 2s;;
  }
</style>
